<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<f:subview id="dataContent">
    <f:loadBundle basename="offset.nodes.server.view.ApplicationResource" var="msg"/>


        <h:inputHidden value="#{VersionBean.versionManager.pageStart}"/>
        <h:dataTable value="#{VersionBean.versionManager.result}" var="Version" styleClass="table" rowClasses="even,odd" captionClass="dheading1" headerClass="header" columnClasses="icon,vversion,vdate,vuser,vcomment">
           <f:facet name="caption">
                <h:outputText value="#{msg.captionVersions}"/>
            </f:facet>


            <h:column>
                <f:facet name="header">
                    <h:outputText value=""/>
                </f:facet>
                <h:graphicImage value="#{NodesBean.imagePath}/version.png" alt="#{msg.version}" title="#{msg.version}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.versionName}" />
                </f:facet>
                <h:outputLink value="#{NodesBean.repositoryPath}#{Version.frozenNodePath}">
                    <h:outputText value="#{Version.name}" styleClass="table"/>
                </h:outputLink>
            </h:column>        
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.versionDate}" />
                </f:facet>
                <h:outputFormat value="{0,date,yyyy.MM.dd HH:mm:ss}" styleClass="table">
                    <f:param value="#{Version.date}"/>
                </h:outputFormat>
            </h:column>        
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.versionUser}" />
                </f:facet>
                <h:outputText value="#{Version.user}" styleClass="table"/>
            </h:column>        
            <h:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.versionComment}" />
                </f:facet>
                <h:outputText value="#{Version.comment}" styleClass="table"/>
            </h:column>        
        </h:dataTable>

        <h:panelGroup rendered="#{VersionBean.versionManager.pager.pagingRequired}">
            <h:commandLink actionListener="#{VersionBean.versionManager.pager.first}">
                <h:graphicImage value="#{NodesBean.imagePath}/start.png"/>
            </h:commandLink>
             &nbsp;
            <h:commandLink actionListener="#{VersionBean.versionManager.pager.previous}">
                <h:graphicImage value="#{NodesBean.imagePath}/previous.png"/>
            </h:commandLink>
             &nbsp;
            <h:commandLink actionListener="#{VersionBean.versionManager.pager.next}">
                <h:graphicImage value="#{NodesBean.imagePath}/next.png"/>
            </h:commandLink>
             &nbsp;
            <h:commandLink actionListener="#{VersionBean.versionManager.pager.last}">
                <h:graphicImage value="#{NodesBean.imagePath}/end.png"/>
            </h:commandLink>
        </h:panelGroup>


</f:subview>